import Vue from "vue";
import App from "./App.vue";
Vue.config.productionTip = false;

//引入路由
import router from "./router";

import TypeNav from "@/components/TypeNav";
Vue.component(TypeNav.name, TypeNav);

import store from "@/store";
import "@/mock/mockServer";
import { MessageBox, Button } from "element-ui";
Vue.component(Button.name, Button);
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
// Vue.prototype.$alert = MessageBox.alert;

import "swiper/dist/css/swiper.min.css";

import Carousel from "@/components/Carousel";
Vue.component(Carousel.name, Carousel);

import Pagination from "@/components/Pagination";
Vue.component(Pagination.name, Pagination);

import * as API from "@/api";

import VueLazyload from "vue-lazyload";
Vue.use(VueLazyload, {
  //懒加载默认的图片
});

import "@/plugins/validate";

new Vue({
  render: (h) => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  router,
  store,
}).$mount("#app");
